package com.cloudpivot.receivales.meta.view;

import lombok.Getter;
import lombok.Setter;

/**
 * 返回 请求的说明
 */
public enum ResponseMetaEnum {

    ONE(-1, "转换PDF时异常"),
    TWO(-2, "对象空,无法转换！"),
    FOUR(-3, "程序异常"),
    THREE(0, "返回成功"),
    ;

    @Getter
    @Setter
    private Integer k;
    @Getter
    @Setter
    private String v;

    ResponseMetaEnum(Integer k, String v) {
        this.k = k;
        this.v = v;
    }

    /**
     * 根据k获取comment
     *
     * @param k
     * @return comment
     */
    public static String getValue(Integer k) {
        if (k==null) {
            return "eNum异常";
        }
        for (ResponseMetaEnum eNum : ResponseMetaEnum.values()) {
            if (eNum.getK().equals(k)) {
                return eNum.getV();
            }
        }
        return "eNum异常";
    }
}
